<%--
    Document   : Viewhistory
    Created on : Jul 11, 2011, 10:17:47 PM
    Author     : Hai
--%>


<%@page import="java.util.List"%>
<%@page import="server.entity.Photo"%>
<%@page import="server.entity.Category"%>
<%@page import="server.entity.AdminLog"%>
<%@page import="server.process.ProcessBeanLocal"%>
<%@page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    <link rel="stylesheet" href="styleAdminManager.css" type="text/css"/>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
    <script type="text/javascript" src="js/newjavascript.js"></script>
</head>
<body>
    <%
                HttpSession sesson = request.getSession();
                if (session.getAttribute("admin") == null) {
    %>
    <jsp:forward page="loginAdmin.jsp"></jsp:forward>
    <%                  }
                  //System.out.println(session.getAttribute("admin"));
%>
    <div id="wrapper">
        <div id="header">

            <h1>Photo Share</h1>
            <img src="header_right.gif" alt="hinh"/>
        </div>
        <div id="nav">
            <ul>
                <li><a href="homeadmin.jsp">Home</a></li>
                <li><a href="ManagerPhoto.jsp">Photo</a></li>
                <li><a href="faq.jsp">FAQ</a></li>
                <li><a href="managecomment.jsp">Comment</a></li>
                <li><a href="ManagerUser.jsp">User</a></li>
                <li><a href="manageContest.jsp">Contest</a></li>
                <li class="end"><a href="ManagerCollection.jsp">Category</a></li>
            </ul>
        </div>

        <div id="main">
            <div id="adminManager">
                <jsp:include page="lefmenu.jsp"></jsp:include>
            </div>
            <div id="contentAdmin">
                <fieldset>
                    <legend> Manage image</legend>
                    <table>
                        <tr>
                            <th>Image Name</th><th>Description</th><th>Image</th><th>Action</th>
                        </tr>
                        <c:forEach var="one" items="${list}">
                            <tr>
                                <td>${one.photoName}</td>
                                <td>${one.descriptions}</td>
                                <td><a><img src="${one.serverFile}" height="150" width="200"/></a></td>
                                <td>
                                    <form action="controlertuan">
                                        <c:if test="${one.status=='true'}">
                                            <input type="hidden" name="id" value="${one.photoID}"/>
                                            <input type="hidden" name="action" value="logImage"/>
                                            <input type="submit" value="log Image"/>
                                        </c:if>
                                        <c:if test="${one.status=='false'}">
                                            <input type="hidden" name="id" value="${one.photoID}"/>
                                            <input type="hidden" name="action" value="activeImage"/>
                                            <input type="submit" value="Active Image"/>
                                        </c:if>
                                    </form>
                                </td>
                            </tr>
                    </c:forEach>
                    </table>
                </fieldset>
            </div>
        </div>
        <div id="footer">

        </div>
    </div>
</body>
</html>